package com.econ.powercloud.ems.common.enums;

/**
 * @Author : zjf
 * @Description : 保留类型
 * @Date : 2022/1/10 16:08
 * @Modified by : zjf
 */
public enum RetainType {
    SAVE(0, "保留"),
    DELETE(1, "删除"),
    ;

    private Integer code;
    private String desc;

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    RetainType(int code, String desc){
        this.code=code;
        this.desc=desc;
    }

    public static String getCodeFromCode(int code){
        for(RetainType type: RetainType.values()){
            if(type.getCode() == code){
                return type.getDesc();
            }
        }
        return null;
    }

}
